package com.designpatterns.proxypattern.impl;

import com.designpatterns.proxypattern.Image;

public class RealImage implements Image
{
	private String fileName;

	public RealImage(String fileName)
	{
		this.fileName = fileName;
		loadFromDisk(fileName);// 实例化这个对象时需要从磁盘加载
	}

	@Override
	public void display()
	{
		System.out.println("Displaying " + fileName);
	}

	private void loadFromDisk(String fileName)
	{
		System.out.println("Loading " + fileName);
	}

}
